package building;

import field.Field.FieldType;


public class Building {
	
	public enum BuildingType{
	HARVESTER,
	POWER_PLANT,
	SILO,
	REFINERY,
	ACCUMULATOR;
	

	public boolean canBeBuildOnThisFieldType(FieldType type) {
		if(this == HARVESTER){
			return type != FieldType.EMPTY;
			} else {
				return type == FieldType.EMPTY;
			}
		}
	
	}
	
	private int lvl = 1;

	private final BuildingType buildingType;
	
	public Building(BuildingType buildingType) {
		this.buildingType = buildingType;
	}

	public boolean canBeBuildOnThisFieldType(FieldType fieldType) {
		return buildingType.canBeBuildOnThisFieldType(fieldType);
	}
	
	public BuildingType getBuildingType() {
		return buildingType;
	}
	
	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("BuildingType: ");
		sb.append(buildingType);
		sb.append("; Lvl: ");
		sb.append(lvl);
		return sb.toString();
	}

}
